//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_FrontEndCall_H
#define Green_FrontEndCall_H

#include <map>

#include "Defines.h"
#include "Enums.h"
#include ARCH_ENUM_HEADER

namespace Green {

  class PyInterface;

  /*
    \ class FrontEndCall
    \ brief class to call functions on front-end
  */

  class FrontEndCall {
  public:
    static void Initialize();  //!< Initialization interface.
    static void Destroy();     //!< Destruction clean up interface.
    inline static FrontEndCall* Instance() { return mspFrontEnd; } //!< Access instance.
    ASSIGNMENT_OPERATOR_ABSENT(FrontEndCall);
    COPY_CONSTRUCTOR_DEFAULT(FrontEndCall);
    inline void SetInterface(PyInterface* interface) { mpPyInterface = interface; } //!< set interface
    uint32 CallBackTemplate(uint32 threadId, ECallBackTemplateType callBackType,  const std::string& primaryValue, const std::map<std::string, uint64>& callBackValues); //!< call back some function on front-end
  private:
    FrontEndCall() : mpPyInterface(nullptr) { } //!< constructor
    virtual ~FrontEndCall()  { } //!< destructor

    static FrontEndCall* mspFrontEnd;  //!< Pointer to singleton FrontEndCall object.
    PyInterface* mpPyInterface; //!< Pointer to the Python interface instance.
  };
}

#endif
